/**
 * @param {number[]} cost
 * @return {number}
 */
// 哪里细节没处理好
var minCostClimbingStairs = function(cost) {
    const dp = []
    for(let i = 0; i < cost.length; i++) {
        // 落点
        if(i == 0 || i == 1) {
            dp[i] = cost[i]
        } else {
            dp[i] = Math.min(dp[i - 1], dp[i - 2]) + cost[i]
        }
    }
    return Math.min(dp[cost.length - 1], dp[cost.length - 2])
};
console.log(minCostClimbingStairs([10,15,20]))
console.log(minCostClimbingStairs([1,100,1,1,1,100,1,1,100,1]))